package ca.etsmtl.log720.tp3.dao;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.ManyToMany;
import javax.persistence.JoinColumn;
import javax.persistence.CascadeType;
import javax.persistence.JoinTable;

@Entity
@Table(name="DOSSIER")
public class Dossier {
    
    @Id    
    @Column(name="ID")    
    @GeneratedValue
    private int id;
    
    @Column(name="NOM")
    private String nom;
    
    @Column(name="PRENOM")
    private String prenom;
    
    @Column(name="NOPERMIS")
    private String noPermis;
    
    @Column(name="NOPLAQUE")
    private String noPlaque;
    
    @ManyToMany(cascade = {CascadeType.ALL})    
    @JoinTable(name="DOSSIERS_MEETING",                 
     joinColumns={@JoinColumn(name="DOSSIER_ID")},
     inverseJoinColumns={@JoinColumn(name="INFRACTION_ID")})
    private List<Infraction> infractions;


    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the nom
     */
    public String getNom() {
        return nom;
    }

    /**
     * @param nom the nom to set
     */
    public void setNom(String nom) {
        this.nom = nom;
    }

    /**
     * @return the prenom
     */
    public String getPrenom() {
        return prenom;
    }

    /**
     * @param prenom the prenom to set
     */
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    /**
     * @return the noPermis
     */
    public String getNoPermis() {
        return noPermis;
    }

    /**
     * @param noPermis the noPermis to set
     */
    public void setNoPermis(String noPermis) {
        this.noPermis = noPermis;
    }

    /**
     * @return the noPlaque
     */
    public String getNoPlaque() {
        return noPlaque;
    }

    /**
     * @param noPlaque the noPlaque to set
     */
    public void setNoPlaque(String noPlaque) {
        this.noPlaque = noPlaque;
    }

    public List<Infraction> getInfractions() {
        return infractions;
    }

    public void setInfractions(List<Infraction> infractions) {
        this.infractions = infractions;
    }
}
